home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / andere sprachen / gamesmaster / demosrc / agacolourlist.s next >
Text File  |  1996-07-16  |  6KB  |  167 lines

  1. ;AGA ColourList
  2. ;--------------
  3. ;Displays an AGA colourlist (24bit colour lines).  To do this we use a
  4. ;raster command specially reserved for colourlists (COL24LIST).
  5. ;Colourlists enable you to have many more colours than would normally be
  6. ;allowed -- even though only 1 bitplane is active,  we have 256 colours
  7. ;on screen.  Now lets see a PC do that :-)
  8. ;
  9. ;To exit the demo, press the left mouse button.
  10.  
  11.     opt    o+
  12.  
  13.     INCLUDE    "exec/exec_lib.i"
  14.     INCLUDE    "games/games.i
  15.     INCLUDE    "games/games_lib.i"
  16.  
  17. CALL    MACRO
  18.     jsr    _LVO\1(a6)
  19.     ENDM
  20.  
  21.     SECTION    "AGA_ColourList",CODE
  22.  
  23. ;===========================================================================;
  24. ;                             INITIALISE DEMO
  25. ;===========================================================================;
  26.  
  27. Start:    MOVEM.L    A0-A6/D1-D7,-(SP)
  28.     move.l    ($4).w,a6
  29.     lea    GMS_Name(pc),a1
  30.     moveq    #$00,d0
  31.     CALL    OpenLibrary
  32.     move.l    d0,GMS_Base
  33.     beq.s    Quit
  34.  
  35.     move.l    GMS_Base(pc),a6          ;Set task to user priority.
  36.     CALL    SetUserPri
  37.  
  38.     lea    ScreenStruct(pc),a0      ;Initialise our screen structure.
  39.     CALL    Add_Screen
  40.     tst.l    d0
  41.     bne.s    Error
  42.  
  43.     lea    ScreenStruct(pc),a0      ;Now show the screen.
  44.     CALL    Show_Screen
  45.  
  46. ;===========================================================================;
  47. ;                                MAIN LOOP
  48. ;===========================================================================;
  49.  
  50.     CALL    Wait_LMB
  51.  
  52. ;===========================================================================;
  53. ;                              RETURN TO DOS
  54. ;===========================================================================;
  55.  
  56.     CALL    Delete_Screen            ;Give back screen memory etc.
  57. Error    move.l    GMS_Base(pc),a1
  58.     move.l    ($4).w,a6
  59.     CALL    CloseLibrary
  60. Quit    MOVEM.L    (SP)+,A0-A6/D1-D7
  61.     moveq    #$00,d0
  62.     rts
  63.  
  64. ;===========================================================================;
  65. ;                                  DATA
  66. ;===========================================================================;
  67.  
  68. GMS_Name:
  69.     dc.b    "games.library",0
  70.     even
  71. GMS_Base:
  72.     dc.l    0
  73.  
  74. AMT_PLANES =    1
  75.  
  76. ScreenStruct:
  77.     dc.l    "GSV1"                   ;Structure version.
  78.     dc.l    0,0,0                    ;Screen_Mem1/2/3
  79.     dc.l    0                        ;Screen link.
  80.     dc.l    0                        ;Address of screen palette
  81.     dc.l    RasterList               ;Address of rasterlist
  82.     dc.l    0                        ;Amt of colours in screen palette.
  83.     dc.w    256,320,320/8            ;Screen Height, Width, Width/8
  84.     dc.w    256,320,320/8            ;Pic Height, Width, Width/8
  85.     dc.w    AMT_PLANES               ;Amt_Planes
  86.     dc.w    0,0                      ;Top Of Screen, X/Y
  87.     dc.w    0                        ;Scroll buffer in pixels/8.
  88.     dc.w    0,0                      ;X/Y counterx (for scrolling).
  89.     dc.l    NOBURST|BLKBDR           ;Special attributes.
  90.     dc.w    LORES|_24BITCOL          ;Screen mode.
  91.     dc.b    INTERLEAVED              ;Screen type
  92.     dc.b    0                        ;Screen Is Being Displayed?
  93.     dc.l    0,0                      ;Reserved area.
  94.     even
  95.  
  96. RasterList:
  97.     COL24LIST 000,1,00,Colours       ;Line, Skip, Colnum, ColourList.
  98.     RASTEND
  99.  
  100. Colours:
  101.     dc.l    $010000,$020000,$030000,$040000
  102.     dc.l    $050000,$060000,$070000,$080000
  103.     dc.l    $090000,$0a0000,$0b0000,$0c0000
  104.     dc.l    $0d0000,$0e0000,$0f0000,$100000
  105.     dc.l    $110000,$120000,$130000,$140000
  106.     dc.l    $150000,$160000,$170000,$180000 
  107.     dc.l    $190000,$1a0000,$1b0000,$1c0000
  108.     dc.l    $1d0000,$1e0000,$1f0000,$200000
  109.     dc.l    $210000,$220000,$230000,$240000
  110.     dc.l    $250000,$260000,$270000,$280000
  111.     dc.l    $290000,$2a0000,$2b0000,$2c0000 
  112.     dc.l    $2d0000,$2e0000,$2f0000,$300000 
  113.     dc.l    $310000,$320000,$330000,$340000
  114.     dc.l    $350000,$360000,$370000,$380000
  115.     dc.l    $390000,$3a0000,$3b0000,$3c0000
  116.     dc.l    $3d0000,$3e0000,$3f0000,$400000 
  117.     dc.l    $410000,$420000,$430000,$440000 
  118.     dc.l    $450000,$460000,$470000,$480000
  119.     dc.l    $490000,$4a0000,$4b0000,$4c0000
  120.     dc.l    $4d0000,$4e0000,$4f0000,$500000
  121.     dc.l    $510000,$520000,$530000,$540000 
  122.     dc.l    $550000,$560000,$570000,$580000 
  123.     dc.l    $590000,$5a0000,$5b0000,$5c0000
  124.     dc.l    $5d0000,$5e0000,$5f0000,$600000
  125.     dc.l    $610000,$620000,$630000,$640000
  126.     dc.l    $650000,$660000,$670000,$680000 
  127.     dc.l    $690000,$6a0000,$6b0000,$6c0000 
  128.     dc.l    $6d0000,$6e0000,$6f0000,$700000
  129.     dc.l    $710000,$720000,$730000,$740000
  130.     dc.l    $750000,$760000,$770000,$780000
  131.     dc.l    $790000,$7a0000,$7b0000,$7c0000 
  132.     dc.l    $7d0000,$7e0000,$7f0000,$800000 
  133.     dc.l    $810000,$820000,$830000,$840000
  134.     dc.l    $850000,$860000,$870000,$880000
  135.     dc.l    $890000,$8a0000,$8b0000,$8c0000
  136.     dc.l    $8d0000,$8e0000,$8f0000,$900000 
  137.     dc.l    $910000,$920000,$930000,$940000 
  138.     dc.l    $950000,$960000,$970000,$980000
  139.     dc.l    $990000,$9a0000,$9b0000,$9c0000
  140.     dc.l    $9d0000,$9e0000,$9f0000,$a00000
  141.     dc.l    $a10000,$a20000,$a30000,$a40000 
  142.     dc.l    $a50000,$a60000,$a70000,$a80000 
  143.     dc.l    $a90000,$aa0000,$ab0000,$ac0000
  144.     dc.l    $ad0000,$ae0000,$af0000,$b00000
  145.     dc.l    $b10000,$b20000,$b30000,$b40000
  146.     dc.l    $b50000,$b60000,$b70000,$b80000 
  147.     dc.l    $b90000,$ba0000,$bb0000,$bc0000 
  148.     dc.l    $bd0000,$be0000,$bf0000,$c00000
  149.     dc.l    $c10000,$c20000,$c30000,$c40000
  150.     dc.l    $c50000,$c60000,$c70000,$c80000
  151.     dc.l    $c90000,$ca0000,$cb0000,$cc0000 
  152.     dc.l    $cd0000,$ce0000,$cf0000,$d00000 
  153.     dc.l    $d10000,$d20000,$d30000,$d40000
  154.     dc.l    $d50000,$d60000,$d70000,$d80000
  155.     dc.l    $d90000,$da0000,$db0000,$dc0000
  156.     dc.l    $dd0000,$de0000,$df0000,$e00000 
  157.     dc.l    $e10000,$e20000,$e30000,$e40000 
  158.     dc.l    $e50000,$e60000,$e70000,$e80000
  159.     dc.l    $e90000,$ea0000,$eb0000,$ec0000
  160.     dc.l    $ed0000,$ee0000,$ef0000,$f00000
  161.     dc.l    $f10000,$f20000,$f30000,$f40000 
  162.     dc.l    $f50000,$f60000,$f70000,$f80000 
  163.     dc.l    $f90000,$fa0000,$fb0000,$fc0000
  164.     dc.l    $fd0000,$fe0000,$ff0000
  165.     dc.l    -1
  166.  
  167.